<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>首页</title>
	</head>
	
	<body>
		<div title="公共数据">
		[#if var_islogin] [#-- 判断是否登录 --]
			${var_member.bmbNick}<br/> [#-- 显示登录会员昵称 --]
		[/#if]
		${var_webcfg.swcWebname}<br/> [#-- 显示网站名称 --]
		${var_contextpath}<br/> [#-- 显示应用程序路径 --]
		</div>
		
		<p/>
		
		<div title="导航配置">
		[#-- 读取导航数据的自定义标签，参数：par_page 显示页面，par_position 显示位置。 --]
		[@ecs_navigation par_page = 1 par_position = 1]
			[#list var_navlist as nav] [#-- 循环导航配置列表 --]
				<a href="${nav.sncContent}">${nav.sncName}</a>
			[/#list]
		[/@ecs_navigation]
		</div>
		
		<p/>
		
		<div title="广告配置">
		[#-- 读取广告数据的自定义标签，参数：par_page 显示页面，par_position 显示位置。 --]
		[@ecs_advertise par_page = 1 par_position = 1]
			[#list var_advlist as adv] [#-- 循环广告配置列表 --]
				<a href="${adv.sacContent}">${adv.sacName}</a>
			[/#list]
		[/@ecs_advertise]
		</div>
		
		<div title="商品分类树">
		<script type="text/javascript">
			function createTreeNode(nodeId, nodeText, parentId) {
				var groupTree = document.getElementById("grouptree");
				
				var prefixText = "";
				var parentPrefix = document.getElementById("prefix_" + parentId);
				if (parentPrefix != null) {
					if (parentPrefix.innerHTML == "") {
						prefixText = "|-";
					} else {
						prefixText = "&nbsp;" + parentPrefix.innerHTML;
					}
				}
				
				var prefixSpan = document.createElement("span");
				prefixSpan.id = "prefix_" + nodeId;
				prefixSpan.innerHTML = prefixText;
				groupTree.appendChild(prefixSpan);
				
				var textSpan = document.createElement("span");
				textSpan.id = "text_" + nodeId;
				textSpan.innerHTML = nodeText;
				groupTree.appendChild(textSpan);
				
				var newLine = document.createElement("br");
				groupTree.appendChild(newLine);
			}
		</script>
		<div id="grouptree"></div>
		[#-- 创建分类树根节点的自定义宏，参数：par_datalist 分类数据列表。--]
		[#macro ecs_grouptreeroot par_datalist]
			[#list par_datalist as data]
				[#if data.bggParent == "0"]
					<script type="text/javascript">
						createTreeNode("${data.bggId}", "${data.bggName}", "${data.bggParent}");
					</script>
					[@ecs_grouptreechild par_datalist = par_datalist par_parentid = data.bggId/]
				[/#if]
			[/#list]
		[/#macro]
		[#-- 创建分类树子节点的自定义宏，参数：par_datalist 分类数据列表，par_parentid 父级分类ID。--]
		[#macro ecs_grouptreechild par_datalist par_parentid]
			[#list par_datalist as data]
				[#if data.bggParent == par_parentid]
					<script type="text/javascript">
						createTreeNode("${data.bggId}", "${data.bggName}", "${data.bggParent}");
					</script>
					[@ecs_grouptreechild par_datalist = par_datalist par_parentid = data.bggId/]
				[/#if]
			[/#list]
		[/#macro]
		[#-- 读取商品分类数据的自定义标签，参数：par_treeid 选择分类ID。--]
		[@ecs_classified par_treeid = "0"]
			[@ecs_grouptreeroot par_datalist = var_grouplist/]
		[/@ecs_classified]
		</div>
		
		<p/>
		<div title="商品列表">
		[#-- 读取商品列表数据的自定义标签，参数：par_goodstype 精品？新品？热销？团购，par_goodsgroup 商品分类(无值或空值默认所有)，par_pageindex 第几页，par_pagesize 显示数量 --]
		[@ecs_goodslist par_goodstype="new" par_goodsgroup="4028815c390f6ee901390f8a73100011" par_pageindex=1 par_pagesize=10]
			[#list var_goodslist.data as glst] [#-- 商品列表 --]
				${glst.bgiName}<br/>
			[/#list]
		[/@ecs_goodslist]
		</div>
		<p/>
		<div title="商品信息">
		[#-- 读取商品信息数据的自定义标签，参数：par_goodsid--]
		[@ecs_goodsinfo par_goodsid="40288133397b8a4e01397b9c15350005"]
				[#if var_goodsinfo??]
				<p>${var_goodsinfo.bgiName!"空"}</p><p>${var_goodsinfo.bgiGsn!"空"}</p>
				[/#if]
		[/@ecs_goodsinfo]
		</div>
		<p/>
		<div title="商品属性">
		[#-- 读取商品属性数据的自定义标签，参数：par_goodsid--]
		[@ecs_goodsattr par_goodsid="40288133397b8a4e01397b9c15350005"]
			[@ecs_goodsallattr par_datalist = var_goodsattr/]			
		[/@ecs_goodsattr]
		[#-- 创建商品所有属性属性的自定义宏，参数：par_datalist 商品所有属性。--]
		[#macro ecs_goodsallattr par_datalist]
			[#--参数bgaTattr用于判断价格属性类型是否相同--]
			[#assign bgaTattri = "0"]
			[#list par_datalist as data]
				[#if data.bgaTattri!=bgaTattri]
					<br/><strong>${data.btaName}:</strong>${data.bgaValue}
				[#else]
					,${data.bgaValue}
				[/#if]
				[#assign bgaTattri=data.bgaTattri]
			[/#list]
		[/#macro]
		</div>
		<p/>
		<div title="商品价格属性">
		[#-- 读取商品属性数据的自定义标签，参数：par_goodsid，par_isprice--]
		[@ecs_goodsattr par_goodsid="40288133397b8a4e01397b9c15350005" par_isprice=true]				
			[@ecs_goodsprice par_datalist = var_goodsattr/]
		[/@ecs_goodsattr]
		[#-- 创建商品价格属性的自定义宏，参数：par_datalist 价格属性。--]
		[#macro ecs_goodsprice par_datalist]
			[#--参数bgaTattr用于判断价格属性类型是否相同--]
			[#assign bgaTattri = "0"]
			[#list par_datalist as data]
				[#if data.bgaTattri!=bgaTattri]
					[#switch data.btaAtype]
						[#case 0]
							<p>${data.btaName}:${data.bgaValue}</p>
							[#break]
						[#case 1]
							<strong>${data.btaName}</strong>
							<p><input id="rg-${data.bgaId}" type="radio" name="rg-${data.bgaTattri}" value="${data.bgaPrice}"/><label for="rg-${data.bgaId}">${data.bgaValue}加￥${data.bgaPrice}元</label></p>
							[#break]
						[#case 2]
							<p><strong>${data.btaName}</strong></p>
							<p><input id="cb-${data.bgaId}" type="checkbox" name="cb-${data.bgaTattri}" value="${data.bgaPrice}"/><label for="cb-${data.bgaId}">${data.bgaValue}加￥${data.bgaPrice}元</label></p>
							[#break]	
						[#default]
							[#break]		
					[/#switch]
				[#else]
					[#switch data.btaAtype]
						[#case 0]
							<p>${data.bgaValue}</p>
							[#break]
						[#case 1]
							<p><input id="rg-${data.bgaId}" type="radio" name="rg-${data.bgaTattri}" value="${data.bgaPrice}"/><label for="rg-${data.bgaId}">${data.bgaValue}加￥${data.bgaPrice}元</label></p>
							[#break]
						[#case 2]
							<p><input id="cb-${data.bgaId}" type="checkbox" name="cb-${data.bgaTattri}" value="${data.bgaPrice}"/><label for="cb-${data.bgaId}">${data.bgaValue}加￥${data.bgaPrice}元</label></p>
							[#break]	
						[#default]
							[#break]		
					[/#switch]
				[/#if]
				[#assign bgaTattri=data.bgaTattri]
			[/#list]
		[/#macro]		
		</div>
		<p/>
	</body>
</html>
